<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="top.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet"  href="static/css/bootstrap.min.css"/>
	<link rel="stylesheet" href="static/js/select2/select2.css">
	<style type="text/css">
		.body{
			padding-top:60px;
		
		}
	
	</style>
</head>
<body class="body">
	
	
	<div class="container">
		<div class="row">
			<div class="span9">
				<form class="form-horizontal"  id="myform"  action="addproject.jspx" method="post">
				<fieldset>
					<legend>开始一个新项目</legend>
					<div class="control-group">
						<label class="control-label" for="input01">项目名称</label>
						<div class="controls">
							<input type="text" name="name" class="span5" id="input01" />
						</div>
					</div>
				<div class="control-group">
					<label class="control-label" for="input01">项目描述</label>
					<div class="controls">
						<textarea name="desc" class="span5" rows="4"></textarea>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="multiSelect">负责人</label>
					<div class="controls">
						<select name="manager" class="multiSelect">
							<c:forEach  items="${UserList}" var="user">
								<option value="${user.id}">${user.name}</option>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="input01">项目成员</label>
					<div class="controls">
						<select name="worker" id="worker" multiple class="multiSelect" style="width:500px">
               				<c:forEach items="${UserList}" var="user">
                	    		 <option value="${user.id }">${user.name }</option>
                   			</c:forEach>
             			 </select>
					</div>
				</div>
			<input type="hidden" name="workers" id="workers" />
				<div class="form-actions">
					<button type="submit" id="btnSave"  class="btn btn-primary">保存</button>
					<button class="btn" onclick="location.back()">返回</button>
				
				</div>
			</fieldset>
			</form>
			
			</div>
       </div>
    </div>
	
	<script type="text/javascript"  src="static/js/jquery.js" ></script>
	<script type="text/javascript" src="static/js/select2/select2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".multiSelect").select2();
			
			$("#btnSave").click(function(){
				var v = $("#worker").select2("val");
				$("#workers").val(v);
				$("#myform").submit();
					});
			
			});
		
	
	</script>
	
	
	
	
	
	
	
	
	
	
	
	
	
</body>
</html>